package com.kystar.muxplayer;

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.Spinner;

public class UIHelper {

    private UIHelper(){}

    public static Spinner setupSpinner(Spinner spinner, String[] items, int resID,int dropDownId) {//R.layout.spinner_source_dropdown
        ArrayAdapter<String> adapter = new ArrayAdapter<String>(spinner.getContext(),
            resID, android.R.id.text1, items);
//        {
//            @Override
//            public View getDropDownView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
//                if( parent != null) {
//                    hideSystemUI(parent);
//                }
//                return super.getDropDownView(position, convertView, parent);
//            }
//        };
        adapter.setDropDownViewResource(dropDownId);
        spinner.setAdapter(adapter);
        return spinner;
    }
}
